

import 'package:flutter/material.dart';

class KeyBoardUtils{

  ///隐藏软键盘
  ///[context] 上下文
  static hideKeyboard(BuildContext context){
    FocusScopeNode currentFocus = FocusScope.of(context);
    if(!currentFocus.hasPrimaryFocus && currentFocus.focusedChild!=null) {
      FocusManager.instance.primaryFocus?.unfocus();
    }
  }

}